<template>
    <div class="staticDisplay" :style="{ height: Math.ceil(this.data.data.length / 3) * 47.4667 + 42 + 'vw' }">
        <div class="top">
            <img :src="data.img" alt="">
        </div>
        <div class="staticDisplay-container swiper-container"
            :style="{ background: `linear-gradient(to bottom, transparent 16.3vw, ${data.bgc} 16.3vw, ${data.bgc} 100%)` }">
            <div class="swiper-wrapper">
                <div class="swiper-slide" v-for="item in data.data" :key="item.id">
                    <img :src="item.goods_thumb" alt="">
                    <div class="info">
                        <span class="title">{{ item.title }}</span>
                        <span class="newPrice">{{ item.shop_price_formated }}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>


export default {
    props: ["data"],
    data() {
        return {
        }
    },
    mounted() {
    },

}
</script>

<style scoped>
.staticDisplay {
    width: 94.6667vw;
    margin: 2.6667vw auto;
    box-sizing: border-box;
    border-radius: 2.6667vw;
    position: relative;
    /* height: 89.3333vw; */
    overflow: hidden;
}

.top {
    display: flex;
    width: 100%;
    height: 52.8vw;
    object-fit: cover;
    box-sizing: border-box;
    z-index: 2;
    img {
        border-radius: 2.6667vw;
    }
}


.staticDisplay-container {
    display: flex;
    width: 94.6667vw;
    flex-direction: column;
    padding-left: 2.6667vw;
    padding-bottom: 8vw;
    position: relative;
    bottom: 18.6667vw;
    box-sizing: border-box;
    z-index: 1;
    border-radius: 2.6667vw;
}
.swiper-wrapper{
    display: flex;
    flex-wrap: wrap;
    gap:  2.1333vw 1.3333vw;
}

.staticDisplay-container .swiper-slide {
    width: 29.3333vw;
    display: flex;
    flex-direction: column;
    border-radius: 2.6667vw;
    overflow: hidden;
    z-index: 4;
    .info {
        background-color: #fff;
    }
}

.staticDisplay-container img {
    width: 29.3333vw;
    height: 26.6667vw;
}

.staticDisplay-container span {
    font-size: 3.2vw;
    display: block;
}

.staticDisplay-container .title {
    width: 26.6667vw;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 6.4vw;
    font-size: 3.7333vw;
    padding-left: 2.6667vw;
    box-sizing: border-box;
}

.staticDisplay-container .newPrice {
    color: red;
    font-weight: bold;
    font-size: 3.7333vw;
    line-height: 8vw;
    text-align: left;
    padding-left: 2.6667vw;
}
</style>